/*
 * <<
 *  Davinci
 *  ==
 *  Copyright (C) 2016 - 2019 EDP
 *  ==
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *        http://www.apache.org/licenses/LICENSE-2.0
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *  >>
 *
 */

package com.cwf.metadatamanage.service;

import com.cwf.metadatamanage.model.dtos.*;
import com.cwf.metadatamanage.model.pojo.Source;
import com.github.pagehelper.PageInfo;
import com.cwf.metadatamanage.exception.NotFoundException;
import com.cwf.metadatamanage.exception.ServerException;
import com.cwf.metadatamanage.model.dtos.*;
import com.cwf.metadatamanage.model.vo.req.SourceReq;

import java.util.List;

public interface SourceService {

    List<DatasourceType> getDatasources();

    PageInfo<Source> getSources(SourceReq sourceReq) throws NotFoundException, ServerException;

    Source getSourceDetail(Long id) throws NotFoundException, ServerException;

    Source createSource(SourceCreate sourceCreate) throws NotFoundException, ServerException;

    Source getSource(Long id);

    Source updateSource(SourceInfo sourceInfo) throws NotFoundException, ServerException;

    boolean deleteSource(Long id) throws NotFoundException, ServerException;

    boolean testSource(SourceTest sourceTest) throws ServerException;

    boolean reconnect(Long id, DbBaseInfo dbBaseInfo) throws NotFoundException, ServerException;

    List<String> getSourceDbs(Long id) throws NotFoundException, ServerException;

    DBTables getSourceTables(Long id, String dbName) throws NotFoundException;

    TableInfo getTableInfo(Long id, String dbName, String tableName) throws NotFoundException;

}
